Derivation of complex fourier series